(function(e){"use strict";BX.addCustomEvent(window,"BX.Landing.Block:init",(function(e){n(e);a(e);t(e);l(e);i(e);r(e)}));BX.addCustomEvent("BX.Landing.Block:Node:update",BX.debounce(n,200));BX.addCustomEvent("BX.Landing.Block:Cards:update",(function(e){n(e)}));BX.addCustomEvent("BX.Landing.Block:Card:add",(function(e){n(e)}));BX.addCustomEvent("BX.Landing.Block:Card:remove",(function(e){n(e)}));function n(e){var n=e.makeRelativeSelector(".navbar-nav");if(e.block.querySelectorAll(n).length>0){d(n);c(n)}}function a(e){if(BX.Landing.getMode()!=="edit"){var n=e.makeRelativeSelector(".js-scroll-nav");var a=e.block.querySelectorAll(n);if(a.length>0){[].slice.call(a).forEach((function(e){BX.Landing.NavbarScrollSpy.init(e)}))}}}function t(e){var n=e.block.querySelector(e.makeRelativeSelector(".navbar.u-navbar-modal"));if(n&&BX.Landing.getMode()==="edit"){BX.adjust(n,{children:[BX.create("div",{props:{className:"g-landing-alert-v3 "+(n.dataset.modalAlertClasses||"")},html:BX.message("LANDING_NAVBAR_MODAL_ALERT")})]})}}function l(e){if(BX.Landing.getMode()!=="edit"){var n=e.block.querySelector(e.makeRelativeSelector(".navbar.u-navbar-slider"));var a=e.block.querySelector(e.makeRelativeSelector(".navbar-toggler"));if(n&&a){a.addEventListener("click",(function(){document.body.classList.toggle("g-overflow-hidden")}))}}}function i(e){if(BX.Landing.getMode()!=="edit"){var n=e.block.querySelector(".g-menu-multilevel");if(n){f(n)}}}function r(n){if(BX.Landing.getMode()!=="edit"){const a=n.block.querySelector(".collapse");if(a){const t=[].slice.call(a.querySelectorAll(".nav-item"));if(!!t&&t.length){t.forEach((function(n){BX.bind(n,"click",(n=>{e(a).collapse("hide")}))}))}const l=n.block.querySelector(".hamburger");if(l){e(a).on("hide.bs.collapse",(()=>{l.classList.remove("is-active")}));e(a).on("show.bs.collapse",(()=>{l.classList.add("is-active")}))}}}}function c(e){if(BX.Landing.getMode()==="edit"){if(!o(e)){u(document.querySelector(e).querySelector(".nav-item"))}}else{s(e)}}function o(e){var n=false;var a=landingParams["LANDING_ID"];if(a===undefined||a===null){return false}var t=document.querySelector(e);var l=[].slice.call(t.querySelectorAll(".nav-link"));if(!!l&&l.length){var i=new RegExp("#landing([0-9]+)");l.forEach((function(e){var t=e.href.match(i);if(t!==null&&t[1]===a){u(BX.findParent(e,{className:"nav-item"}));n=true}}))}return n}function s(e){var n=false;var a=document.location;var t=document.querySelector(e);var l=[].slice.call(t.querySelectorAll(".nav-link"));if(!!l&&l.length){l.forEach((function(e){if(e.hasAttribute("href")&&e.getAttribute("href")!==""&&e.getAttribute("href")!=="#"&&e.pathname===a.pathname&&e.hostname===a.hostname&&e.hash===""){var t=BX.findParent(e,{className:"nav-item"});u(t);n=true}}))}return n}function u(e){if(e){e.classList.add("active");BX.adjust(e,{children:[BX.create("span",{props:{className:"sr-only"},text:"(current)"})]})}}function d(e){var n=document.querySelector(e);var a=[].slice.call(n.querySelectorAll(".nav-item"));if(!!a&&a.length){a.forEach((function(e){v(e)}))}}function v(e){e.classList.remove("active");BX.remove(e.querySelector("span.sr-only"))}function f(e){var n=[].slice.call(e.querySelectorAll(".g-menu-sublevel"));n.forEach((function(e){var n=BX.findPreviousSibling(e,{class:"nav-link"});if(!n){return}m(n);if(e.querySelector(".nav-item.active")){B(n)}BX.addClass(n,"g-menu-sublevel-toggler--parent");const a=BX.create("div");n.childNodes.forEach((function(e){a.append(e.cloneNode(true))}));n.innerHTML="";n.append(a);BX.adjust(n,{children:[BX.create("span",{props:{className:"g-menu-sublevel-toggler"},html:'<span class="is-hide-text">'+BX.message("LANDING_NAVBAR_TOGGLER_SHOW")+'</span><span class="is-show-text">'+BX.message("LANDING_NAVBAR_TOGGLER_HIDE")+"</span>",events:{click:function(e){e.preventDefault();e.stopPropagation();g(BX.findParent(e.target,{class:"nav-link"}))}}})]})}))}function g(e){if(BX.hasClass(e,"g-menu-sublevel-toggler--parent-hide")){B(e)}else{m(e)}}function m(e){BX.addClass(e,"g-menu-sublevel-toggler--parent-hide");var n=BX.findNextSibling(e,{class:"g-menu-sublevel"});if(n){BX.addClass(n,"g-menu-sublevel--hide")}}function B(e){BX.removeClass(e,"g-menu-sublevel-toggler--parent-hide");var n=BX.findNextSibling(e,{class:"g-menu-sublevel"});if(n){BX.removeClass(n,"g-menu-sublevel--hide")}}})(window.jQueryLanding||jQuery);
//# sourceMappingURL=menu_init.map.js